﻿/**
 *
 * @file FITKAbstractAssInstance.h
 * @brief 抽象装配体实例定义
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-03-29
 *
 */
#ifndef __FITK_ABSTRACT_INSTANCE_H___
#define __FITK_ABSTRACT_INSTANCE_H___

#include "FITKInterfaceModelAPI.h"
#include "FITKAbstractModel.h"

namespace Interface
{
     /**
      * @brief 抽象装配体实例
      * @author LiBaojun (libaojunqd@foxmail.com)
      * @date 2024-03-29
      */
    class FITKInerfaceModelAPI FITKAbstractAssInstance : public  FITKAbstractModel
    {
        FITKCLASS(Interface, FITKAbstractAssInstance);
    public:
        /**
         * @brief Construct a new FITKAssemblyInstance object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-03-22
         */
        explicit FITKAbstractAssInstance() = default;
        /**
         * @brief Destroy the FITKAssemblyInstance object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-03-22
         */
        virtual ~FITKAbstractAssInstance() = 0;

        /**
         * @brief 获取模型类型
         * @return AbsModelType
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-02-27
         */
        virtual FITKModelEnum::AbsModelType getAbsModelType();
        /**
         * @brief 设置modelID
         * @param[i]  modelid        模型ID
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-03-22
         */
        void setModel(int modelid);
        /**
         * @brief 设置模型
         * @param[i]  model          设置模型
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-03-22
         */
        void setModel(FITKAbstractModel* model);
        /**
         * @brief 获取模型对象
         * @return FITKAbstractModel*
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-03-22
         */
        FITKAbstractModel* getModel() const;

        /**
         * @brief 获取模型对象id
         * @return int
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-04-30
         */
        int getModelID() const;

        template<class T>
        /**
         * @brief 获取到数据对象并转换类型
         * @return T*
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-03-22
         */
        T* getModelT()
        {
            return dynamic_cast<T*>(this->getModel());
        }

        /**
         * @brief 获取集合/表面管理器
         * @return Interface::FITKModelSetManager*
         * @author libaojun (libaojunqd@foxmail.com)
         * @date 2024-03-17
         */
        virtual FITKComponentManager* getComponentManager() override;

        /**
         * @brief 获取模型维度
         * @return FITKModelDim
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-04-11
         */
        virtual FITKModelEnum::FITKModelDim getModelDim() override;

    protected:
        /**
         * @brief 模型ID
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-03-22
         */
        int _modelID{ -1 };


    };
}


#endif
